import com.alibaba.fastjson.{JSON, JSONObject}
import com.google.gson.Gson
import org.apache.commons.lang.StringUtils

/**
  * description:
  * Rabcheng
  * Date:2019/4/3 15:09
  **/
object TestJsonStr {

  def main(args: Array[String]): Unit = {

    val jo = new JSONObject()

    val person = Person("zs", 1)

    //    jo.put("name",person.name)
    //    jo.put("age",person.age)
    //    jo.toJavaObject()


    //    println(jo.toJSONString)

    val jsonObj: JSONObject = JSON.parseObject("{\n\n    \"id\": 93774962,\n    \"keyNo\": \"0073825adc90895a43f433874eaeec63\",\n    \"name\": \"费县星光铜版纸有限公司\",\n    \"No\": \"3713251800075\",\n    \"belongOrg\": \"费县工商行政管理局\",\n    \"operName\": \"唐公义\",\n    \"startDate\": \"1996-12-16\",\n    \"endDate\": \"\",\n    \"status\": \"吊销\",\n    \"updatedDate\": \"2017-04-20T19:44:15+08:00\",\n    \"shortStatus\": \"吊销\",\n    \"creditCode\": \"\",\n    \"registCapi\": \"68万人民币\",\n    \"econKind\": \"有限责任公司\",\n    \"industryCode\": \"C\",\n    \"subIndustryCode\": \"22\",\n    \"industry\": \"制造业\",\n    \"subIndustry\": \"造纸和纸制品业\",\n    \"scope\": \"高中档铜版纸、文化纸；生产；销售。\",\n    \"contactNumber\": \"\",\n    \"email\": \"\",\n    \"webSite\": \"\",\n    \"imageUrl\": \"http://co-image.qichacha.com/CompanyImage/default.jpg\",\n    \"orgNo\": \"\",\n    \"englishName\": \"\",\n    \"product\": \"\",\n    \"type\": 0,\n    \"originalName\": \"\",\n    \"hitField\": \"投资人\",\n    \"hitValue\": \"<em>马召龙</em>\",\n    \"address\": \"上冶镇驻地 \",\n    \"provinceCode\": \"3700\",\n    \"cityCode\": \"1\",\n    \"countyCode\": \"1\",\n    \"province\": \"山东省\",\n    \"city\": \"无\",\n    \"county\": \"无\",\n    \"registCapiNum\": \"680000\"\n\n}")
    println(jsonObj.getString("product"))
    var str = jsonObj.getString("product")
    str = ""
    if (StringUtils.isEmpty(str)) {
      println(str)
    }

    /*val gson = new Gson()
    val str = gson.toJson(person)
    println(str)*/

  }

}


case class Person(name: String, age: Int)
